#include <mysql/mysql.h>
#include <string>
#include <vector>
using std::string;
using std::vector;
namespace moqi
{

    class MySQLClient
    {
    public:
        MySQLClient();
        ~MySQLClient();
        void init();
        void connect(const char *host = "localhost",
                     const char *user = "root",
                     const char *password = "580231",
                     const char *db = "homework",
                     unsigned short port = 3306);

        // 写操作封装(INSERT/UPDATE/DELETE)
        bool writeOperationQuery(const string &sql);
        // 读操作封装(SELECT)
        vector<vector<string>> readOperationQuery(const string &sql);

    private:
        MYSQL _conn;
    };

} // end of namespace moqi
